import { defineEventHandler } from 'h3';

export default defineEventHandler(async () => {
  // 模拟统计数据
  return {
    total: 156,
    byType: {
      entity: 45,
      service: 32,
      capability: 28,
      data: 23,
      algorithm: 18,
      model: 10,
    },
    byCategory: {
      room: 25,
      equipment: 20,
      product: 15,
      booking: 18,
      payment: 14,
      workflow: 22,
      form: 16,
      rule: 12,
      report: 14,
    },
    byStatus: {
      active: 142,
      inactive: 8,
      draft: 4,
      deprecated: 2,
    },
    recentCreated: [
      {
        id: '1',
        name: '标准双人间',
        type: 'entity',
        createdAt: '2024-01-15T10:30:00Z',
      },
      {
        id: '2',
        name: '预订服务',
        type: 'service',
        createdAt: '2024-01-14T15:20:00Z',
      },
      {
        id: '3',
        name: '支付工作流',
        type: 'capability',
        createdAt: '2024-01-13T09:45:00Z',
      },
    ],
    recentUpdated: [
      {
        id: '1',
        name: '标准双人间',
        type: 'entity',
        updatedAt: '2024-01-15T16:20:00Z',
      },
      {
        id: '2',
        name: '预订服务',
        type: 'service',
        updatedAt: '2024-01-14T11:30:00Z',
      },
    ],
  };
});
